function reduced = redDim(data, srcA, srcB, dstA, dstB)
	
	targetCols = dstA*dstB;
	
	if(srcA/dstA!=floor(srcA/dstA) || srcB/dstB!=floor(srcB/dstB))
		printf("Nonconformant dimensions. No conversion.");
		reduced=data;
		return;
	end;
	mx = zeros(size(data,2),dstB*dstA);
	for(targetCol=1:targetCols)
		for(sourceRow=1:srcA/dstA)
			for(sourceCol=1:srcB/dstB)
			mx((sourceRow-1)*srcA+sourceCol + floor((targetCol-1)/dstB)*srcA*(srcB/dstB) + (mod(targetCol-1,dstB))*(srcA/dstA) ,targetCol)=1;
			end;
		end;
	end;
	#size(mx)
	#mx
	reduced=data*mx;
end;
